package cn.logicalthing.demo.web.interceptor;

import cn.logicalthing.demo.web.controller.ControllerBase;
import cn.logicalthing.demo.web.interceptor.LoginInterceptorScore;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

public class LoginInterceptorNotifyFriend extends LoginInterceptorScore implements HandlerInterceptor {
    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
       Map<String,Object> result = getResult(request);
       String userId = getUserId(request);
       if(ControllerBase.SUCCESS_CODE_200.equals(result.get(ControllerBase.RESPONSE_CODE))){
           //...
       }
    }
}
